<!--  -->
<template>
  <div class="cart">
    <nav-bar class="cart_title">
      <div slot="center">购物车({{cart_goods.length}})</div>
    </nav-bar>
    <cart-item v-for="(item,index) in cart_goods" :key="index" :cart_good="item" >

    </cart-item>
    <div class="footer">
      <div class="left">合计{{fullprice}}</div>
      <div class="right">去计算({{jisuan}})</div>
    </div>
  </div>
</template>

<script>
import NavBar from "components/common/navbar/NavBar"
import CartItem from "./CartItem"
export default {
  components:{
    NavBar,
    CartItem
  },
  data(){
    return{
        cart_goods:this.$store.getters.getCart,
    }
  },
  computed:{
    fullprice(){
      return this.$store.getters.getfullprice
    },
    jisuan(){
      return this.$store.getters.getjisuan
    }
  }
}

</script>
<style scoped>
.cart{
  position: relative;
}
.cart_title{
  background-color: var(--color-tint);
  color:#fff;
}
.footer{
  position: fixed;
  bottom: 50px;
  left: 0;
  right:0;
  line-height: 40px;
  text-align: center;

}
.footer .left{
  width: 70%;
  background-color: #ccc;
}
.footer .right{
  width: 30%;
  background-color: orangered;
  color:#fff;
}
</style>